import { createRouter, createWebHistory } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'home',
    component: () => import('../view/index.vue'),
    children: [
      { 
        path: '/order',
        name: 'order',
        component: () => import('../view/OrderList.vue')
      },
      { 
        path: '/detail',
        name: 'detail',
        component: () => import('../view/OrderDetail.vue')
      },
      { 
        path: '/category',
        name: 'category',
        component: () => import('../view/category.vue')
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router